<?php
/*
Classe factorisant la gestion des langue
*/
class Lang
{
	public function __construct()
	{
	}
	
	// Ex.: Lang::TRANSLATE("menu_blog")
	public static function TRANSLATE($id)
	{
		$words = new Texts_Collection();
		$word = $words->getByStrId($id);
		
		if($word != null || $word != "")
		{
			if(isset($_SESSION['lang']))
			{
				switch($_SESSION['lang'])
				{
					case "fr":
						return $word->get_fr();
						break;
					/*case "en":
						return $word->get_en();
						break;
					case "es":
						return $word->get_es();
						break;*/
					default:
						return '** LANG MISSING **';
				}
			}
			else
				return $word->get_fr();
		}
		else
			return "!! EMPTY STRING !!";
	}
	
};
?>